<template>
  <transition name="slide-fade">
    <div v-if="visible" class="toast"  :style="{top:tops+'%'}">
      <i class="iconfont" v-if="icons" :class="icons"></i>
      <div>
        {{message}}
      </div>
    </div>
  </transition>
</template>

<script>
import '@/static/image/iconfont.css'
export default {
  data () {
    return {
      visible: false,
      message: '',
      tops: '',
      icons: ''
    }
  },
  methods: {

  },
  mounted () {

  }
}
</script>

<style scoped>
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  transform: translate3d(-50%, -50%, 0);
}

.slide-fade-enter,
.slide-fade-leave-to {
  margin-top: -30px;
  opacity: 0;
}

.slide-fade-enter-active,
.slide-fade-leave-active {
  transition: all 0.3s ease;
}

.slide-fade-enter-to,
.slide-fade-leave {
  margin-top: 0px;
  opacity: 1;
}
</style>